/**
* Copyright (c) 2022 - present TinyVue Authors.
* Copyright (c) 2022 - present Huawei Cloud Computing Technologies Co., Ltd.
*
* Use of this source code is governed by an MIT-style license.
*
* THE OPEN SOURCE SOFTWARE IN THIS PRODUCT IS DISTRIBUTED IN THE HOPE THAT IT WILL BE USEFUL,
* BUT WITHOUT ANY WARRANTY, WITHOUT EVEN THE IMPLIED WARRANTY OF MERCHANTABILITY OR FITNESS FOR
* A PARTICULAR PURPOSE. SEE THE APPLICABLE LICENSES FOR MORE DETAILS.
*
*/

@import '../custom.less';
@import './vars.less';

@filter-box-prefix-cls: ~'@{css-prefix}filter-box';

.@{filter-box-prefix-cls} {
  width: fit-content;
  height: 28px;
  line-height: 28px;
  border-radius: 2px;
  background: #f5f6f8;
  color: #161e26;
  padding: 4px 6px;
  display: flex;
  align-items: center;
  font-size: 12px;

  &:hover {
    background: rgba(92, 172, 255, 0.1);
  }

  &.disabled {
    cursor: not-allowed;

    .title label {
      color: #b5bbce;
    }

    .value {
      color: #5c6976;
    }

    svg.filter-box-icon {
      fill: #b5bbce;
      cursor: not-allowed;
    }
  }

  .title {
    height: inherit;

    label {
      display: inline-block;
      max-width: 100px;
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
      color: #78828d;
      margin-right: 4px;
    }

    &.active label {
      color: #1890ff;
    }

    svg {
      width: 16px;
      height: 16px;
      margin-right: 4px;
      fill: #8d959e;
      position: relative;
      top: -1px;
      vertical-align: super;

      &:hover {
        fill: #1890ff;
      }
    }
  }

  .value {
    max-width: 100px;
    height: inherit;
    margin-right: 4px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .filter-box-icon {
    width: 12px;
    height: 12px;
    cursor: pointer;
    fill: #78828d;
    transition: transform 0.3s;

    &.is-reverse {
      transform: rotate(180deg);
    }
  }

  .filter-icon-close {
    width: 16px;
    height: 16px;
    cursor: pointer;
    fill: #b5bbce;

    &:hover {
      fill: #78828d;
    }
  }
}
